import {httpClient} from "@/core/http/httpClient";
import {ddDmMatch} from "@/api/baseUrl";
/**
 *@typedef BaseResponse
 *@template T
 *@property {number} status
 *@property {number} code
 *@property {string} message
 *@property {string} [detailMsg]
 *@property {T} data
 *@property {boolean} ok
 */
/**
 *@typedef PageData
 *@template T
 *@property {number} total
 *@property {T[]} rows
 */
/**
 *@typedef DmDetail
 *@property {number} number
 *@property {string} nickName
 *@property {string} headImgUrl
 *@property {string} workVideoUrl
 *@property {string} profile
 *@property {number} taskTicketNum
 *@property {number} giveTicketNum
 *@property {number} collectTicketNum
 *@property {number} ticketNum
 *@property {number} rank
 */
/**
 * @author vidy3587@gmail.com
 * @description 获取dm详情
 * @param {string} queryParam
 * @return {Promise<BaseResponse<DmDetail>>}
 * */
export const getDmDetail = (queryParam) => {
    return httpClient.post(`/${ddDmMatch}/activities/dd2021DMMatch/getDMInfoByIdOrName`, {queryParam})
};

/**
 *@typedef DmItem
 *@property {number} number
 *@property {string} nickName
 *@property {string} headImgUrl
 *@property {number} ticketNum
 *@property {number} rank
 */

/**
 * @author vidy3587@gmail.com
 * @description 获取dm列表
 * @param {number} pageNum
 * @param {number} pageSize
 * @return {Promise<BaseResponse<PageData<DmItem>>>}
 * */
export const getDmList = ({pageNum, pageSize}) => {
    return httpClient.post(`/${ddDmMatch}/activities/dd2021DMMatch/getDMList`, {pageNum, pageSize})
}

/**
*@typedef DmRankItem
*@property {number} number
*@property {string} nickName
*@property {number} taskTicketNum
*@property {number} giveTicketNum
*@property {number} collectTicketNum
*@property {number} ticketNum
*/
/***
 * @author vidy3587@gmail.com
 * @param {PageQuery} pageQuery
 * @return {Promise<BaseResponse<PageData<DmRankItem>>>}
 */
export const getRankList = (pageQuery) => {
    return httpClient.post(`/${ddDmMatch}/activities/dd2021DMMatch/getRankList`, pageQuery)
}

